package com.xy.jm.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xy.common.annotation.DataSource;
import com.xy.common.enums.DataSourceType;
import com.xy.jm.entity.JmUserEntity;
import com.xy.jm.mapper.JmUserMapper;
import com.xy.jm.service.JmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@DataSource(value = DataSourceType.JM)
@Transactional(rollbackFor = Exception.class)
@Service
public class JmUserServiceImpl implements JmUserService {
    @Autowired
    private JmUserMapper jmUserMapper;
    @Override
    public List<JmUserEntity> list() {
        QueryWrapper<JmUserEntity> qryWrapper = new QueryWrapper<>();
        qryWrapper.le("user_id",500);
        return jmUserMapper.selectList(qryWrapper);
    }
    @Override
    public Integer count() {
        return jmUserMapper.selectCount(null);
    }

    @Override
    public List<JmUserEntity> get_root_list() {
        return jmUserMapper.get_root_list();
    }
}
